Keyboard input coding device and musical note displaying device

ABSTRACT

This invention relates to a keyboard input coding device comprising a counter for counting ON and OFF duration of signals obtained by pushing a keyboard, an encoder for producing codes of musical interval corresponding to keys of the keyboard, a note-length discriminating circuit for taking count values from the counter based on signals from the keyboard and discriminating a note-length, a note-length memory circuit for receiving or supplying the note-length data from or to the note-length discriminating circuit, a reference time generating circuit for supplying the note-length discriminating circuit with data of partitioning a musical section and a processing control circuit, wherein the discrimination of the note-length is effected by referring to the note-length between sequential notes according to data stored in the memory circuit, thereby a musical note with a note-length to agree well with intention of an operator is coded after correcting the key input duration data according to estimates made from the relation of the note-length between sequential notes, and also to a musical note displaying device comprising a CRT display, a character ROM, a video RAM and a timing circuit for these circuits, wherein an additional note-chaining circuit is provided to take musical note data outputted by the keyboard input coding device, note-chaining data (musical interval) between sequential two musical notes and note-chaining pattern selecting data in the musical note data and to generate note-chaining pattern corresponding to musical note position, and the note-chaining pattern data generated from the additional note-chaining circuit and the musical note pattern of the character ROM are superposed so as to produce a chained note thereby a musical note is displayed at pattern which can be clearly seen as a staff.

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates to a keyboard input coding device and a musicalnote displaying device, wherein signals obtained by pushing a keyboardare coded into musical notes for pattern displaying or a staff.

2. Description of the Prior Art

In such a coding device in prior art, duration of pushing keys of akeyboard is coded into note-length data at a real time. A musical notein the coding is therefore liable to be different from that intended bya player.

For example, assuming that a one time reference pulse (in sound output)as shown in "a" of FIG. 1(A) corresponds to one interval of a quarternote, keying input is given in such a pattern as shown in "b" of FIG.1(A) in order to perform continuously. If the coding is based on theintervals t₁ -t₇ of key input "H" (key pushing) and "L" (key releasing)without modification, an intended note is a quarter note as shown in "c"of FIG. 1(A) but quite unreasonable coding of notes would be effected asshown in "d" of FIG. 1(A).

Also, assuming that one time reference pulse as shown in "a" of FIG.1(B) corresponds to one interval of a quarter note, a triplet as shownin "c" of FIG. 1(B) is intended. Since a triplet is discriminated whenone interval of silence is followed by one interval including threenotes of nearly equal note-length (a quarter note), the coding based onkey input intervals in such a pattern as shown in "b" of FIG. 1(B) in areal time would produce the code output as shown in "d" of FIG. 1(B).Accordingly, detection of a triplet in this manner is quite difficult.

When a keyboard input is displayed as pattern of musical note signals,for example, if a musical note character is constituted by eighth orsixteenth notes with hook, indication of the character per note producesa staff which is quite indistinct as shown in FIG. 2(A).

Accordingly, it is an object of this invention is to provide a keyboardinput coding device in which a musical note with a note-length to agreewell with intention of a player is coded after correcting the key inputduration data according to estimates made from the relation of thenote-length between sequential notes.

Another object of the invention is to provide a musical note displayingdevice in which sequential eighth or sixteenth notes are coded by theabove described keyboard input coding device and displayed in the formof a chain of notes under a given condition thereby the displayedpattern of musical notes can be readily seen.

This invention relates to a keyboard input coding device comprising akeyboard device for generating signals by means of keying operation,means for detecting rise and fall states of signals from the keyingdevice, a counter for counting ON and OFF duration of the keyboardsignals, an encoder for producing codes of musical intervalcorresponding to keys of the keyboard device, a note-lengthdiscriminating circuit for taking count values from the counter based onsignals from the detecting means and discriminating a note-length, anote-length memory circuit for receiving or supplying the note-lengthdata from or to the note-length discriminating circuit, a reference timegenerating circuit for supplying the note-length discriminating circuitwith data of partitioning a musical section and a processing controlcircuit, wherein the discrimination of the note-length is effected byreferring to the note-length between sequential notes according to datastored in the memory circuit, thereby a musical note with a note-lengthto agree well with intention of an operator is coded after correctingthe key input duration data according to estimates made from therelation of the note-length between sequential notes, and also to amusical note displaying device comprising a CRT display, a characterROM, a video RAM and a timing circuit for these circuits, wherein anadditional note-chaining circuit is provided to take musical note dataoutputted by the keyboard input coding device, note-chaining data(musical interval) between sequential two musical notes andnote-chaining pattern selecting data in the musical note data and togenerate note-chaining pattern corresponding to musical note position,thereby the note-chaining pattern data generated from the additionalnote-chaining circuit and the musical note pattern of the character ROMare superposed so as to produce a chained note and to display a musicalnote at pattern which can be clearly seen.

BRIEF DESCRIPTION OF DRAWINGS

FIGS. 1(A),(B) is a diagram illustrating coding of musical notes using aconventional device;

FIGS. 2(A),(B) is a diagram showing an example representing musicalnotes;

FIG. 3 is a block diagram illustrating an example of a keyboard inputcoding device according to this invention;

FIG. 4 is a specific circuit diagram of a musical interval encoder inthis invention;

FIG. 5 is a specific circuit diagram of a note synthesizing circuit inthis invention;

FIG. 6 is a time chart in a differentiating circuit of this invention;

FIG. 7 is a flow chart illustrating a constitution example of a mainroutine of this invention;

FIGS. 8(A),(B),(C) is a flow chart of interruption routines of a note, arest and a section line respectively;

FIGS. 9(A),(B) is a flow chart of subroutines SUB A, B in abovementioned interruption routines;

FIGS. 10(A),(B) is a flow chart illustrating a specific processing flowof the processing routine ASIN in FIG. 9;

FIG. 11 is a block diagram illustrating an example of a musical notedisplaying device according to this invention;

FIG. 12 is a diagram illustrating relation of position between addressof a video RAM and a display pattern in this invention device;

FIG. 13 is a diagram illustrating relation of position of the highestsound character and the lowest sound character on a staff;

FIG. 14 is a format illustrating a constitution example of musical notecodes;

FIG. 15 is a diagram illustrating a constitution example of a musicalnote character;

FIG. 16 is a schematic diagram illustrating various examples of musicalnote characters; and

FIGS. 17(A),(B),(C) is a diagram illustrating displaying examples ofchained-note patterns according to the invention device.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

An embodiment of this invention will now be described referring to theaccompanying drawings.

FIG. 3 is a block diagram illustrating an example of a keyboard inputcoding device according to this invention. In the figure, referencenumeral 1 designates a keyboard device, and musical sound by pushingkeys of the keyboard device 1 is generated at a speaker 2 through amusical sound generating device contained in the keyboard device.Numeral 3 designates a musical interval encoder to create musicalinterval codes corresponding to individual keys of the keyboarddevice 1. In the case of 31 keys for example, four encoders 3a-3d arecombined for coding eight inputs into three bits as shown in FIG. 4,input terminals T₀ -T₃₁ correspond to individual keys of the keyboard,and musical interval codes of five bits corresponding to 32 inputs of T₀-T₃₁ are entered to output terminals A₀ -A₄. In FIG. 4, E_(I) designatesenable input terminal EO₁ -EO₄ enable output terminals, GS₁ -GS₄terminals to output the "L" level when E_(I) is in enable state and thekeyboard input is entered to any of the input terminals.

A code synthesizing circuit 4 to synthesize musical interval data offive bits obtained in the musical interval encoder 3 and note-lengthdata obtained in a hereinafter described note-length discriminatingcircuit 5, comprises a circuit as shown in FIG. 5 to constitute data ofnine bits. To lines of upper four bits are applied the musical intervaldata to be entered in output terminals W, B₀ -B₂ (W: data to constitutea triplet, B₀ -B₂ : note-length data) of the note-length discriminatingcircuit 5; to lines of lower five bits are applied the musical intervaldata to be entered in output terminals A₀ -A₄ of the musical intervalencoder 3. Synthesized data from the code synthesizing circuit 4, i.e.code data are transmitted through a memory circuit 6 to store themusical interval data into a hereinafter described note patterndisplaying means or the like. The note-length discriminating circuit 5transmits a rest discriminating signal into the code synthesizingcircuit 4. When the rest discriminating signal is entered through a"not" gate NOT into "and" gates AND₀ -AND₄ connected to lines of musicalinterval data, musical interval data outputs b₃ -b₇ are all made "L" anddistinguished from musical note data.

The note-length data is identical in notes and rests. The memory circuit6 is provided so as to enable non-real time processing of a triplet orthe like where two or three notes are output together.

An output terminal GS of the musical interval encoder 3 is connected toa rise differentiating circuit 7 and a fall differentiating circuit 8,which act respectively at the rising state and the falling state ofsignals obtained by pushing keys of the keyboard device 1. Outputsignals of the differentiating circuits 7, 8 are entered as note-lengthprocessing signals in the note-length discriminating circuit 5.

The output terminal GS of the musical interval encoder 3 transmitssignals with wave form shown in FIG. 6"a" by pushing keys. "H" level ofthe signal corresponding to period of key pushing, and "L" levelcorresponds to period of key releasing. At the rising time of signal,differentiating signal PE shown in FIG. 6"b" is transmitted from thedifferentiating circuit 7; at the falling time, differentiating signalNE shown in FIG. 6"c" is transmitted from the differentiating circuit 8.Therefore, if the period from the signal PE to the signal NE is countedby a counter 9, original data of note-length can be obtained as shown int₁, t₃, t₅ of FIG. 6"a"; if the period from the signal NE to the signalPE is counted, original data of rest-length can be obtained as shown int₂, t₄. On receiving the signal PE the note-length discriminatingcircuit 5 takes the count value of the counter 9 as key input restperiod and then resets the counter 9 to start the next counting, whereason receiving the signal NE it takes the count value of the counter 9 askey input period and outputs the reset signal.

As above described, outputs of the rise differentiating circuit 7 andthe fall differentiating circuit 8 are generated respectively at edge ofON and OFF states of key inputs and become interruption signals to makethe note-length discriminating circuit 5 perform processingcorresponding to a musical note and a rest.

The note-length discriminating circuit 5 receives not only the originaldata obtained by the counting operation of the counter 9 but alsosignals from a time reference generating circuit 10. The time referencegenerating circuit 10 properly performs the frequency dividing ofoutputs from clocksignal generating circuit 11 which outputs are usedcommonly with the counter 9 thereby generates one pulse per one intervalof a quarter note and acts as a metronome. The pulse is supplied as dataof partitioning a musical section to the note-length discriminatingcircuit 5 and also to a speaker 12 which produces a time referencesound.

If one pulse is generated per one interval of a quarter note as abovedescribed, one time reference signal is output when the count value ofthe counter 9 becomes 64. Based on this, relation between the originaldata of note-length and the count value is shown in Table 1 as follows:

                                      TABLE 1                                     __________________________________________________________________________    count value                                                                         8-15                                                                             16-23                                                                             24-31                                                                             32-39                                                                             40-47                                                                             48-63                                                                             64-95                                                                             96-127                                                                            128-191                                                                            192-256                             note-length                                                                             /3      /3                  .                                       __________________________________________________________________________

Although Table 1 shows the case of musical notes, allocation of thecount value to the note is similarly applied to the case of rests.However, keying input of the keyboard is always accompanied by a periodof silence when it is transferred from one note to another note. Inorder to avoid the discrimination of this period of silence as asixteenth rest () or a thirty-second rest (), the note-lengthdiscriminating circuit 5 is constituted to neglect a rest of or less,i.e. the count value of 15 or less. Notes or rests in connection withthe count value of a sixteenth note or less, such as are replaced by anynote or rest which is set forth in Table 1 and has the count value closethereto so as to avoid confusion.

A memory circuit 13 is added to the note-length discriminating circuit5, and note-length data taken from the counter 9 and established data ofnote-length discrimination are stored in the memory circuit 2. Therebythe note-length discriminating circuit 5 discriminate the note-lengthsign based on the count value taken from the counter 9 and content ofthe memory circuit 2 (previous count value of the counter) and the signis deduced as shown in Table 2.

                  TABLE 2                                                         ______________________________________                                        note-length  B.sub.o                                                                             B.sub.1     B.sub.2                                                                           W                                          ______________________________________                                                     0     0           0                                                           1     0           0   1/0                                                     0     1           0                                                           1     1           0   1/0                                                     0     0           1                                                           1     0           1                                                           0     1           1                                                           1     1           1                                              ______________________________________                                    

Wherein B₀ -B₂ are codes of three bits corresponding to note-lengthranging - , and W shows one note to constitute a triplet and is addedonly to code of or .

Numeral 14 designates a control circuit (corresponding to a centralprocessing unit CPU) to control the code synthesizing circuit 4, thenote-length discriminating circuit 5 and note-length discriminatingcircuits 6 and 13.

Coding operation of the invention device in above mentioned constitutionwill now be described.

First, a main routine will be described referring to FIG. 7. If the mainroutine is started by reset or power ON at step S₁, it is transferred tostep S₂ and initializing of the system (content of the memory circuit)is performed. Then, if key input is entered by pushing keys of thekeyboard device, it is coded by the musical interval encoder 3, and themusical interval code is entered at step S₃ and stored in the memorycircuit 6 at step S₄. Processings at the steps S₃ and S₄ are repeated,and interruption of outputs from the rise differentiating circuit 7 orthe fall differentiating circuit 8 is waited. As previously mentioned,the interruption includes a musical section line interruption from thetime reference generating circuit 10, a rest interruption from the risedifferentiating circuit 7 and a note interruption from the falldifferentiating circuit 8. The individual interruption subroutines areconstituted as shown in FIG. 8.

FIG. 8(A) shows the note interruption subroutine, FIG. 8(B) the restinterruption subroutine, and FIG. 8(C) the musical section linesubroutine. SUB A designates a note coding routine and SUB B designatesa rest coding routine, and processing flow of both coding routines isconstituted as shown in FIGS. 9(A),(B).

If interruption signal is entered from the fall differentiating circuit8 to the note-length discriminating circuit 5, the note-lengthdiscriminating circuit 5 is in a note coding processing flow, and asshown in FIG. 9(A) the discriminating circuit 5 performes thenote-length allocation assuming that rest discriminating bit=0 andexecutes a note-length discriminating processing routine ASIN. The countvalue X, which is based on the counter 9 at this time and discriminatedby the note-length discriminating circuit 5, is replaced by the countvalue X-1 which is stored in the memory circuit 13 at the previoussampling of one before this time.

At the completion, this processing is returned to step 53 of the musicalinterval code input.

If interruption signal is entered from the rise differentiating circuit8 to the note-length discriminating circuit 5, the rest coding routineSUB B starts and executes a processing flow of FIG. 9(B). In thisprocessing flow, whether the rest-length is X<16 or not is firstdiscriminated, if X<16 the rest-length is neglected and the processingis returned, and the rest smaller than a sixteenth rest is eliminated.If X≧16, rest discriminating bit is set to 1 (it means rest) and thenote-length allocation is performed, and the note-length allocationprocessing routine ASIN is executed. Then, the count value X, which isbased on the counter 9 at this time and discriminated by the note-lengthdiscriminating circuit 5, is replaced by the count value X-1 which isstored in the memory circuit 13 at the previous sampling of one beforethis time. At the completion, this processing is returned to step of themusical interval code input again.

If the musical section line interruption signal is introduced from thetime reference generating circuit 10 to the note-length discriminatingcircuit 5, the note-length discriminating circuit 5 is in a processingflow of FIG. 8(C). In the case of four-quarter measure for example, theprocessing is executed so that a musical section line is entered atevery four intervals of note, and the storing point of note within thesection becomes zero, i.e. N=0 and address A of coding data store fornotes and rests in the memory circuit 6 becomes A=0. In this case, ifthe musical section line interruption is introduced during thekey-pushing operation, discrimination of whether sign is a note or arest cannot be performed. Therefore whether the key input signal is "H"or not is decided, and if the key input signal="H" the subroutine SUB Ais executed, or otherwise if the key input signal is not "H" thesubroutine SUB B is executed.

Operation of the note-length allocation processing ASIN will now bedescribed referring to FIGS. 10(A),(B). In the figure,

N: the number of intervals of a sixteenth note as a unit in a musicalsection (stored in the memory circuit 13)

A: coding data store address for notes and rests in a musical section(stored in the memory circuit 6)

X: count value

X-1: count value of one before this time

WA: auxiliary flag A for discriminating a triplet. If the count valuebecomes 16-23, there is possibility of /3. If the count value of 16-23is detected at the beginning of an interval at unit of a quarter note,WA=1; if it is detected at twice consecutively, WA=2; in other states,WA=0. Thereby the flag is used to help the discrimination of a triplet ().

WB: auxiliary flag B for discriminating a triplet. If the count valuebecomes 32-39, there is possibility of /3. If the count value of 32-39is detected at the beginning of an interval at unit of a quarter note,WB=1; if it is detected at twice consecutively, WB=2; in other states,WB=0. Thereby the flag is used to help the discrimination of a triplet ().

For example, if the count value of X=18 is detected, as shown in FIG.10(A), X<24 is decided at step 1 and whether the detected value is atthe beginning of interval of a quarter note is checked. If the decisionis Yes, there is possibility of a triplet. Then, WA is set to 1, andcode of is registered in the memory circuit 6. If the detected value isnot at the beginning of interval and WA=1, notes having possibility of atriplet appear at twice consecutively. Then, WA is set to 2, and code ofis registered (route of 2 ). In any of above mentioned cases, theinterval cannot be determined until the last note is confirmed thereforesetting of N is not performed.

Processing " →(A)" in step 3 means that code of is registered in thememory circuit 6 shown by address A. In this case, only the note-lengthdata b₀, b₁, b₂ and W among the note data are processed, and the musicalinterval data b₃ -b₇ are held in the previous state.

Step of "output" 5 shows processing that the code data b₀ -b₇ and Wsynthesized in above mentioned manner are transmitted outwards throughthe memory circuit 6. At the same time, address A is incremented by +1.

If the detected value is not at the beginning of interval (N/4≠0) andWA=0, it is decided that there is little possibility of data in X=18constituting one note of a triplet, and processing of non-triplet (routeof 4 ) is performed. In this case, N is always set to any of values, andif necessary the note-length data in address A-1, A-2 is changed andoutputted in sequence. Musical note signs set forth to lateral sides ofroutines in the flow chart shows that combination of notes is decided tobe pattern shown in musical note sign by corresponding processingroutine. This decision is based on values in X and X-1.

Considering above mentioned case (X=18) for example, if WB=0, this noteis decided to be error of either or . When X≧20, step 5 is executedthrough N=N+2; when X<20, routine of (102 ) is executed. If WB≠1, theprevious note-length data also has little possibility of constitutingone note of a triplet. Because, when WB is set to one or two, the countvalue X ranges 32-39 as shown in Table 1 and is distinguished from valueX<24. In this case, therefore, the note-length data registered inaddress A-1 or A-2 in the memory circuit 13 must be changed. Criterionof changed data is value of X in the previous processing of one beforethis time, that is X-1. In the case of this example (X=18), if WB=1, theprocessing executed in routine of 6 , and after decrementing A by 1 thevalue of X-1 is checked. When X-1≧36, the preceeding note by one isdecided to be ; when X-1<36, the preceeding note by one is . Moreover,data of X at this time are classified in similar manner to the above byX≧20 and X<20, thereby registered in any four patterns , , , andregistered.

If the processing is executed in route 1 → 2 → 3 in this example, WA isset to 2. That is, a triplet is completed, if further one value 16≦X<24is entered. If value of 16≦X<24 is really entered, is registered throughroute 101 and outputted. If X<16, since X-1 and X are in close value, itis decided that the previous two values are correct and new input data Xis error of a triplet.

However, if X-1 is greater than 20, pattern is deemed to be morereasonable. Above mentioned processing route is shown in route 7 → 8 → 9or 7 → 8 → 10 of FIG. 10(B).

Although FIG. 10(A) illustrates the decision processing only that to aneighth note or less, note-length codes of , , , , , , may bediscriminated in similar criterion and processing from route 200 and soon.

FIG. 11 shows an example of a musical note displaying device accordingto this invention. In the figure, numeral 21 designates a video RAM towrite and read out data from the coding device or the like by addressscanning signal from a timing circuit 22, and display position of onecharacter on a displaying surface of a CRT display 23 corresponds to oneaddress of the video RAM 21. The displaying surface of this embodimentis composed of horizontal 64 characters by vertical 4 lines, and FIG. 12shows relation of position between address of the video RAM 21 and thedisplaying surface. Musical note data stored in address of the video RAM21 are note codes corresponding to the number of all characters ofmusical interval data (from the highest tone to the lowest tone) andnote-length data (from a sixteenth note to a whole note). If the musicalinterval extends between the upper third space and the lower third spaceshown in FIG. 13, the musical interval codes become 19 sorts (notincluding ♯, ♭) and the note-length becomes eight sorts , , , , , , , .Accordingly, if the musical interval codes are five bits and thenote-length codes are three bits, these codes may be constituted bycodes of eight bits as shown in FIG. 14.

Since five bits are provided for the musical level codes, codes of 32sorts can be used at the maximum therefore a margin is left for 19sorts. If specific interval code for example "0000" is defined as a restcode, various rests can be represented by combination with note-lengthcodes A₀, A₁, A₂. Furhtermore, residual member of the interval data canbe utilized for representing ♯, ♭, ♮, , section line or the like.

The musical note data requires chained note pattern selecting code offour bits as data of the video RAM. Therefore the video RAM data areconstituted in 12 bits including the chained note pattern selecting codeof four bits as shown in FIG. 14.

In FIG. 11, numeral 24 designates a character ROM. In the character ROM24, note codes of data transmitted from the video RAM 21 are madeaddress signals and note patterns based on the address signals areoutputted as display data. FIG. 15 shows an example of a character insuch a processing. As clearly seen from FIG. 15, one character iscomposed of dots arranged in lateral 10 by vertical 64. The numberranging 0-63 in vertical direction is called ROW address, and scanningis effected in sequence from the top in timed relation with the videoscanning line. Note codes outputted from the video RAM 21 correspond toupper address of the character ROM 24, and ROW address scanning signalsoutputted from the timing circuit 24 correspond to lower address.

Display data from the character ROM 24 are entered through a gatecircuit 25 (group of OR gates) in a video signal synthesizing circuit26. The video signal synthesizing circuit 26 synthesizes the displaydata from the character ROM 24 and horizontal and vertical synchronizingsignals from the timing circuit 22, and transmitts the synthesizedsignals as serial data into a CRT display 23 so as to perform themusical note displaying.

An additional note-chaining circuit 27 for displaying a chained notecomprises an additional video RAM 28, a subtractor 29 and an additionalROM 30. The additional video RAM 28 is composed of 256 words by 6 bitsin similar manner to the video RAM 21, and address scanning signals areapplied thereto from the timing circuit 22 and address assignment basedon this corresponds to the same position of displaying surface as thevideo RAM 21. Chained-note data to be entered are written in address forchained-note display; maximum value of ROW address (value of 63 in thisembodiment) is written in address without chained-note displaying. Asshown in FIG. 2(B), vertical position of a chain to connect twosequential notes depends on height of the notes, i.e. the musicalinterval. Accordingly, data regarding the connecting position arewritten to the additional RAM as vertical address data corresponding tothe ROW address.

The subtractor 29 receives the vertical address data from the additionalRAM, i.e. height data B and the ROW address signal R from the timingcircuit 22. Data of R-B=S are entered in the additional ROM 30 asstarting address for ROW address to generate the chained-note pattern.

The additional ROM 30 receives also the chained-note pattern selectingcode from the video RAM 21, and transmitts chained-note patterncorresponding to position on five lines of a staff based on thechained-note pattern generating ROW address data and the chained-notepattern selecting data through the gate circuit 25 into the video signalsynthesizing circuit 26.

In order to produce a chained-note pattern, all following conditionsmust be satisfied.

(a) Sixteenth or eighth notes appear at twice consecutively.

(b) In the case of sequential sixteenth notes, the previous note is atan interval of the order of odd number in unit of a sixteenth note.

(c) In the case of sequential eighth notes, the previous note is at afirst interval in unit of a quarter note in similar manner to condition(b).

(d) Musical interval between two sounds is within three degrees.

(e) Height of two sounds is disposed on the same side with respect tothe third line (same hook direction).

(f) The subsequent sound is not accompanied by ♯, ♭, ♮.

According to the above mentioned conditions, the chained-note patternsto be stored in the additional ROM 30 requires 12 sorts as set forth inTable 3. In Table 3, "previous" indicates that the note corresponding tothe chained-note pattern is the previous note (see FIG. 17(A), addressA₁ side), and "subsequent" indicates that it is the subsequent note (seeFIG. 17(A), address A₂ side).

Individual chained-note pattern selecting codes are set as shown inTable 3. The chained-note pattern selecting codes are defined as upperaddress in the ROW address data, stored in the additional ROM 30, andsupplied from upper four bits of outputs of the video RAM 21. Individualchained-note patterns in Table 3 are illustrated in FIG. 16.

                  TABLE 3                                                         ______________________________________                                               previous/                selecting                                     note   subsequent     direction code                                          ______________________________________                                        1/16   previous       up        0 0 0 0                                       "      "              horizontal                                                                              0 0 0 1                                       "      "              down      0 0 1 0                                       "      subsequent     up        0 1 0 0                                       "      "              horizontal                                                                              0 1 0 1                                       "      "              down      0 1 1 0                                       1/8    previous       up        1 0 0 0                                       "      "              horizontal                                                                              1 0 0 1                                       "      "              down      1 0 1 0                                       "      subsequent     up        1 1 0 0                                       "      "              horizontal                                                                              1 1 0 1                                       "      "              down      1 1 1 0                                       ______________________________________                                    

Operation of the device will now be described.

If the satisfication of above mentioned conditions (a)-(f) forchained-note indication is discriminated in external discriminatingcircuit or the like, musical note data of a quarter note in place of aneighth note or a sixteenth note is written in address of the video RAMwhich requires chained-note indication. At the same time, any ofchained-note selecting data set forth in Table 3 is written to upperfour bits of the video RAM, chained-note pattern to be superposed withthe quarter note pattern is selected. Also ROW address data to generatechained-note pattern is written to the additional video RAM.

For example, assuming that the musical note pattern of address A₁, A₂ ofthe video RAM 21 is as high as shown in FIG. 17(B), front address (B1,B₂) of the additional ROM 30 to be superposed with the musical notepattern (B) is set so that B₁ =26, B₂ =29 as shown in FIG. 17(A).Thereby display pattern in FIG. 17(C) is obtained.

That is, chained-note data is written to the additional video RAM 28 sothat output of the additional video RAM 28 in address A₁ becomes 26, andoutput of the additional video RAM in address A₂ becomes 29. Output ofthe additional video RAM is subtracted at the subtractor 29 from ROWaddress data. Thereby in address A₁,

    ROW address≧26

Subtraction output is positive and increased in order S=1, 2, 3, . . .as the ROW address increases. Also in address A₂,

    ROW address≧29

Subtraction output is positive and increased in order S=1, 2, 3, . . .as the ROW address increases. If the subtraction output S is made ROWaddress data of the additional ROM 30, relative position with respect tobasic character ROM pattern of the additional ROM 30 can be controlled.

If the subtraction output is negative, the additional ROM 30 does notproduce pattern, therefore output of the additional ROM is inhibitedusing the carry output C₀ of the subtractor 29. As above described,maximum ROW address=63 is not outputted from the additional video RAM inaddress which does not produce chained-note pattern, thereforesubtraction output is always negative and the additional ROM does notproduce output.

As above described, when ROW address data to generate chained-notepattern is written to the additional video RAM and RAM address signalgenerated from the timing circuit 22 becomes a prescribed value, thevideo RAM 21 produces musical note data of a quarter note andchained-note pattern selecting data, and the additional video RAM 28produces ROW address data for generating chained-note pattern, thereforethe character ROM 24 produces chained-note pattern corresponding to aquarter note as above described.

If sum of each bit of outputs of the character ROM 24 and correspondingbit of the additional ROM 30 is synthesized in the video signalsynthesizing circuit 26, a quarter note and chained-note pattern aresuperposed thereby chained-note pattern as shown in FIG. 17(C) isobtained.

As above described, a keyboard input coding device of this invention isprovided with a memory circuit, thereby credibility of note-length datais checked by referring to relation of sequential notes and the mostreasonable series of notes are set, therefore key input by pushing keyscan be coded into note input to agree well with intention of a user, anddetection of a triplet can be effected at high credibility, therebyapplication to electronic musical instruments such as synthesizer ispossible. A musical note displaying device utilizing musical notesignals outputted from the keyboard input coding device can connectsequential eighth or sixteenth notes as a chained note under a givencondition and display the chained-note pattern, thereby application inpattern displaying on a CRT display, that is, a musical compositiondevice including a staff which can be clearly seen, is possible.

I claim:
 1. An electronic musical instrument comprising a keyboard meansfor generating the keyboard signals by means of keying operation,amusical interval code producing means for producing the musical intervalcodes based on the keyboard signals from the said keyboard means, adetecting means for detecting rise and fall states of the said keyboardsignals, a counting means for counting ON and OFF duration of the saidkeyboard signals and outputting counting data, a memory means of datafor note-length coding for memorizing predetermined comparing data andtriplet discriminating data, a note-length discriminating means forreceiving said counting data based on signals from the said detectingmeans and coding the said counting data according to said comparing datain the said memory means and correcting the data according to the saidtriplet discriminating data taken in sequence and thus providingnote-length data for discriminating the note-length of the notes havingpossibility of a triplet, and a controlling means for controlling thesaid memory means and note-length discriminating means.
 2. An electronicmusical instrument according to claim 1, wherein the said controllingmeans is provided with a note data memory circuit, which stores saiddiscriminated note-length data as having possibility of a triplet andwhich outputs a chained-noted sign when chained-note data correspondingto one interval is stored.
 3. An electronic musical instrument accordingto claim 2, wherein the said memory means of data for note-lengthcoding, in which the said triplet discriminating data has a data X-1immediately preceding an original data X of note-length to bediscriminated and also a data corresponding to the number of notes atthe beginning of an interval.
 4. An electronic musical instrumentaccording to claim 3, wherein the said controlling means has a controlcircuit which codes the note-length original data X to the note-lengthof a triplet by the said comparing data previously determined, andregisters the coded data X in the said note data memory circuit withoutmodification, if the said coded data X is at the beginning of oneinterval, and registers the coded data X as data having possibility of atriplet in the said note data memory circuit, if said coded data X isnot at the beginning of one interval, only when the data X-1 is coded insimilar note-length of a triplet.
 5. An electronic musical instrumentaccording to claim 1, wherein the musical interval code producing meanscomprises a plurality of encoders in parallel arrangement for producingsignals of three bits from eight inputs connected to the said keyboardmeans, signal lines to indicate which of said plurality of encoders isselected in keying operating of the said keyboard, and a gate circuit ofthe said bits of each of said plurality of encoders as parallel inputsand producing interval output signals to indicate musical interval. 6.An electronic musical instrument according to claim 1 wherein thenote-length discriminating means comprises a reference time generatingcircuit for supplying a data for partitioning a musical section and aspeaker connected to said reference time generating circuit to generatea signal tone for metronome.
 7. An electronic musical instrumentaccording to claim 1, wherein the said controlling means is a controlcircuit which is controlled in program control by a central processingunit CPU.
 8. A musical note displaying device comprising a timingcircuit which produces the output of an address scanning signal, a videoRAM for taking the input of the said address scanning signal and amusical note data, a character ROM for generating a musical note patternbased on the signal from the said video RAM, and said address scanningsignal, an additional note-chaining circuit for taking note-chainingdata of a musical interval between sequential two musical notes andnote-chaining pattern corresponding to musical note position, and alsocomprising a synthesizing circuit for producing the output of asynthesized pattern according to the note-chaining pattern generatedfrom the said additional note-chaining circuit and the musical notepattern generated from the said character ROM, and a CRT display fordisplaying a musical note in a pattern based on said synthesized patternfrom said synthesizing circuit.
 9. A musical note displaying deviceaccording to claim 8, wherein said additional note-chaining circuitcomprises an additional video RAM to write chained-note data as verticaladdress data corresponding to a ROW address, a subtractor to subtractoutput of the additional video RAM from ROW address data of the timingcircuit, and an additional ROM for chained-note pattern to receive thesubtractor output as ROW address data.
 10. A musical note displayingdevice according to claim 8 or 9, comprising a first discriminatingcircuit to discriminate that sixteenth or eighth notes appear twiceconsecutively, a second discriminating circuit to discriminate that theprevious note is at an interval of the order of odd number in unit of asixteenth note in the case of sequential sixteenth notes, a thirddiscriminating circuit to discriminate that the previous note is at afirst interval in unit of a quarter note in similar manner to conditionof the said second discriminating circuit in the case of sequentialeighth note, and a fourth discriminating circuit to discriminate thatthe subsequent note among the sequential notes are note accompanied by♯, ♭, and ♮, and also comprising a selecting circuit wherein the addressof the video RAM is changed and chained-note pattern is selected basedon output of the first discriminating circuit through the fourthdiscriminating circuit, and also comprising a control circuit forcontrolling the same first discriminating circuit through fourthdiscriminating circuit and the said selecting circuit as well whereinsaid device further comprises a means for determining whether theinterval between sounds is three degrees or less and means fordetermining whether the height of two sounds is disposed on the sameside with respect to a third line of a staff.